' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     R E C O L O R   S P E E D   T E S T E R   -   1 0 0 0   L I N E S   -   N E W   T I M E S   O N L Y 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '   - - - - - - -   C o l o r A l l L i n e s _ S t a r t i n g W i t h _ A n d _ C o n t a i n i n g               4 1   m S 
 
 L a b e l   p i p p o o o o o o o o 
 
 R e t u r n 
 
 
 
 '   - - - - - - -   C o l o r A l l L i n e s _ S t a r t i n g W i t h                                             4 6   m S 
 
 F o r   v 1   =   0   T o   9 
 
 N e x t 
 
 
 
 '   - - - - - - -   C o l o r A l l L i n e s _ S t a r t i n g W i t h                                             4 0   m S 
 
 V a r i a b l e   S t r i n g   I n f o 
 
 V a r i a b l e   S t r i n g   R e s u l t 
 
 
 
 '   - - - - - - -   C o l o r A l l L i n e s _ S t a r t i n g W i t h                                             8 0   m S 
 
 I f   v 1   =   v 2 
 
 E n d I f 
 
 
 
 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 F o r   v 1   =   0   T o   3 
 
 	 v 1   =   4 
 
 N e x t 
 
 
 
 
 
 O p t i o n   S p e e d   9 
 
 B u t t o n   1   T e x t   " H o m e   M 0 ( X ) " 
 
 B u t t o n   2   T e x t   " H o m e   M 1 ( Y ) " 
 
 B u t t o n   3   T e x t   " H o m e   M 2 ( Z ) " 
 
 B u t t o n   4   T e x t   " H o m e   M 3 ( A ) " 
 
 
 
 B u t t o n   7   T e x t   " S T A R T   T E S T " 
 
 B u t t o n   8   T e x t   " L o w e r   H a n d l e r " 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ T e r m i n a l . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t s T o S p e e c h . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ M i c r o V i d e o . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S i g n a l S c o p e . e x e 
 
 
 
 V a r i a b l e   N u m e r i c   D i g i t T i m e 
 
 V a r i a b l e   N u m e r i c   N u m T e s t 
 
 V a r i a b l e   N u m e r i c   N u m C y c l e s 
 
 
 
 V a r i a b l e   N u m e r i c   C o o r d _ Z 
 
 V a r i a b l e   N u m e r i c   C o o r d _ A 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X P 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X R 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d Z e r o 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 V a r i a b l e   S t r i n g   I n f o 
 
 V a r i a b l e   S t r i n g   R e s u l t 
 
 
 
 D i g i t T i m e   =   1 . 4 
 
 
 
 S a v e   S t r i n g T o F i l e   s 9   s 2 	 	 	 ' < < < < < < < < < < < < < < 
 
 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t M 0 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t M 0 
 
 K e y   U p   	 	 	 G o s u b   M o v e R i g h t M 1 
 
 K e y   D o w n   	 	 G o s u b   M o v e L e f t M 1 
 
 K e y   P a g e u p 	 	 G o s u b   M o v e U p M 2 
 
 K e y   P a g e d o w n 	 G o s u b   M o v e D o w n M 2 
 
 K e y   S 	 	 	 G o s u b   " S T A R T _ T E S T " 
 
 
 
 G o s u b   R E D 
 
 S t o p 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =     P   I   N         T   E   S   T     = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " S T A R T _ T E S T " 
 
 	 S a v e   S t r i n g T o F i l e   " - = - = - = - S T A R T - = - = - = - "   s 2 
 
 	 N u m T e s t   =   I n p u t   " T e l l   m e   h o w   m a n y   c y c l e : " 
 
 	 N u m C y c l e s   =   0 
 
 	 L a b e l   L o o p T e s t 
 
 	 	 N u m C y c l e s   =   N u m C y c l e s   +   1 
 
 	 	 I f   N u m C y c l e s   >   N u m T e s t 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 G o s u b   " H O M E   A l l " 
 
 	 	 G o s u b   " R a i s e   H a n d l e r " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   O N 
 
 	 	 C o o r d _ Z   =       1 8 
 
 	 	 C o o r d _ A   =     1 2 3 
 
 	 	 C o o r d _ X P   =   1 9 4 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   P A D L O C K " 
 
 	 	 C o o r d _ Z   =       3 8 
 
 	 	 C o o r d _ A   =       9 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   1 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =       9 3 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   2 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =     1 0 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   3 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   4 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =       9 3 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   5 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =     1 0 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   6 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   7 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =       9 3 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   8 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =     1 0 8 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   9 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =     1 2 2 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   0 
 
 	 	 ' C o o r d _ Z   =       3 7 
 
 	 	 ' C o o r d _ A   =     1 0 8 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   E N T E R 
 
 	 	 C o o r d _ Z   =       3 8 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 6 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 G o s u b   " L o w e r   H a n d l e r " 
 
 	 	 G o s u b   " C h e c k   L a t c h " 
 
 	 	 G o s u b   " H O U S E " 
 
 	 	 s 1   =   N o w 
 
 	 	 s 1   =   s 1   +   "   "   +   F o r m a t ( N u m C y c l e s ,   " 0 0 0 " )   +   "   "   +   R e s u l t 
 
 	 	 P r i n t   s 1 
 
 	 	 S a v e   S t r i n g T o F i l e   s 1   s 2 
 
 	 G o t o   L o o p T e s t 
 
 R e t u r n 
 
 
 
 L a b e l   " E X E C " 
 
 	 S l o t ( 5 )     =   C o o r d _ Z 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 2 5 )   =   C o o r d _ A 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 1 )     =   C o o r d _ X P 
 
 	 W a i t   S e c o n d s   D i g i t T i m e 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 1 )     =   C o o r d _ X R 
 
 	 G o s u b   P a u s e 
 
 R e t u r n 
 
 
 
 L a b e l   " C h e c k   L a t c h " 
 
 	 S l o t ( 2 5 )   =     6 2           	 ' A   C h e c k   i f   l a t c h   i s   o u t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 I f   S l o t ( 3 2 )   >   5 0 0 
 
 	 	 R e s u l t   =   "   P A S S "   	 	 	 	 '   l a t c h   i n s i d e 
 
 	 E l s e 
 
 	 	 R e s u l t   =   "   < < <   F   A   I   L   > > > " 	 	 '   l a t c h   o u t s i d e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H A N D L E R   M A N A G E M E N T   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " R a i s e   H a n d l e r " 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     1 5 	   	 ' Z   p e p a r e   f o r   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =   1 0 0 	       	 ' Z   r a i s e   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =     1 8 	       	 ' Z   L o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 7 5           	 ' X   g o t o   s a f e   a r e a 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   " L o w e r   H a n d l e r " 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   p e p a r e   f o r   l o w e r   a r e a 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   l o w e r   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   h a n d l e   m a n a g e m e n t   a r e a 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =       5 	       	 ' Z   l o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   r e t u r n   h a n d l e r   t o   M i d d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - -   S   U   B   R   O   U   T   I   N   E       A   R   E   A     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   = = = = = = = = = = = = = = =   H O M E   A L L   M O T O R s   M 0 ,   M 1 ,   M 2   = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O M E   A l l " 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   5 
 
 	 G o s u b   " H o m e   M 3 ( A ) " 
 
 	 G o s u b   " H o m e   M 2 ( Z ) " 
 
 	 G o s u b   " H o m e   M 1 ( Y ) " 
 
 	 G o s u b   " H o m e   M 0 ( X ) " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 0 ( X ) " 
 
 	 S l o t M o t o r   =   1 
 
 	 S l o t S e n s o r   =   1 9 
 
 	 S p e e d S e a r c h   =   - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 1 ( Y ) " 
 
 	 S l o t M o t o r   =   3 
 
 	 S l o t S e n s o r   =   2 0 
 
 	 S p e e d S e a r c h   =   - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 2 ( Z ) " 
 
 	 S l o t M o t o r   =   5 
 
 	 S l o t S e n s o r   =   2 1 
 
 	 S p e e d S e a r c h   =   + 0 . 1 
 
 	 S p e e d R e t u r n   =   - 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   1 0 3 
 
 	 I n i t i a l P o s i t i o n   =   1 0 0 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 3 ( A ) " 
 
 	 S l o t M o t o r   =   2 5 
 
 	 S l o t S e n s o r   =   3 1 
 
 	 S p e e d S e a r c h   =   - 0 . 0 8 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O U S E   A L L   M O T O R S   M 0 ,   M 1 ,   M 3   = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O U S E " 
 
 	 S l o t ( 5 )     =     9 8 	   	 ' Z   R a i s e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =     2           	 ' X   g o   t o   H O U S E 
 
 	 S l o t ( 2 5 )   =     2           	 ' A   g o   t o   H O U S E 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   M O T O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H o m e " 
 
 	 G o s u b   R E D 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0             '   d e t a c h   I f   s e n s o r   a c t i v e 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
 	 L a b e l   S e a r c h H o m e 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   	 '   l i m i t   s w i t c h 
 
 	 	 	 G o s u b   W a i t M o t o r 	 	 	 '   W A I T   U N T I L   M O T O R   S T O P 
 
 	 	 	 G o t o   D e t a c h S e n s o r 
 
 	 	 E n d I f 
 
 	 	 G o t o   S e a r c h H o m e 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n   '   d i r e c t i o n / s p e e d   r e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   A s s i g n Z e r o 
 
 	 E n d I f 
 
 	 G o t o   D e t a c h S e n s o r 
 
 L a b e l   A s s i g n Z e r o 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 	 	 	 '   R e s e t   t h e   S l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 0 8 	 	     	 	 '   D O   N O T   T O U C H ,   n e e d e d   t o   t h e   M a s t e r ! ! ! ! 
 
 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d Z e r o 
 
 	 G o s u b   W a i t M o t o r 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   Y E L 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d   = = = = = = = = 
 
 L a b e l   W a i t M o t o r 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   i a   r u n n i n g 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t 1 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 	 	 	 '   n o w   t h e   m o t o r   i s   n o t   r u n n i n g 
 
 	 	 E n d I f 
 
 	 	 ' W a i t   S e c o n d s   0 . 0 0 5 
 
 	 G o t o   W a i t 1 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t M o t o r 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T     a l l   M O T O R S   a r e   S T O P P E D   = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t A l l M o t o r s 2 
 
 	 	 ' I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 )   )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1 
 
 	 	 I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 2 6 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 G o t o   W a i t A l l M o t o r s 2 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t A l l M o t o r s 
 
 
 
 '   = = = = = = = = = = = = = = =   E N A B L E   /   D I S A B L E   M O T O R S   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' L a b e l   E n a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 ' 
 
 ' L a b e l   D i s a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   1 0 0 0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   P A U S E   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P a u s e 
 
 	 L a b e l   P a u s e L o o p 
 
 	 	 I f   S l o t ( 1 2 )   >   5 0 0 
 
 	 	 	 W a i t   S e c o n d s   0 . 2 
 
 	 	 	 G o s u b   Y E L 
 
 	 	 E l s e 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 G o s u b   R E D 
 
 	 G o t o   P a u s e L o o p 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   M O V E   U S I N G   K E Y B O A R D   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   M o v e R i g h t M 0 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e L e f t M 0 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e R i g h t M 1 
 
 	 S l o t ( 2 5 )   =   S l o t ( 2 5 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e L e f t M 1 
 
 	 S l o t ( 2 5 )   =   S l o t ( 2 5 )   -   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e U p M 2 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e D o w n M 2 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   -   1 
 
 R e t u r n 
 
 
 
 ' = = = = = =   D U M M Y   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' = = = = = =   T O   D O   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' = = = = = =   S E T   U P   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '           N a m e : 	 W X M _ D o o r L o c k q 1 _ V 5 . 6 . t x t           D a t e :     2 1   S e p t e m b e r   2 0 1 9 
 
 '         A u t o r :   L e o n a r d o   D E   P A L O   P h . D . 
 
 '         S c o p e :   G e n e r a t i n g   a   t e s t   r o b o t   f o r   D o o r L o c k   s y s t e m 
 
 '   H a r d w a r e :   U s i n g   t h e   o l d   c a r t e s i a n   s y s t e m . 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' 
 
 '   = = = = = = = = = = =   M I C R O S T E P   H A R D W A R E   S E T   U P     = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' L o a d   x x x x x x . j p g 
 
 
 
 ' = = = = = = = = = = = = = = = =   G E N E R A T I N G   T H E   L O G   F I L E   N A M E   = = = = = = = = = = = = = = = = = = = = = 
 
 s 2   =   T e s t _ L o c k . t x t 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 O p t i o n   S p e e d   9 
 
 B u t t o n   1   T e x t   " H o m e   M 0 ( X ) " 
 
 B u t t o n   2   T e x t   " H o m e   M 1 ( Y ) " 
 
 B u t t o n   3   T e x t   " H o m e   M 2 ( Z ) " 
 
 B u t t o n   4   T e x t   " H o m e   M 3 ( A ) " 
 
 
 
 B u t t o n   7   T e x t   " S T A R T   T E S T " 
 
 B u t t o n   8   T e x t   " L o w e r   H a n d l e r " 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ T e r m i n a l . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t s T o S p e e c h . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ M i c r o V i d e o . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S i g n a l S c o p e . e x e 
 
 
 
 V a r i a b l e   N u m e r i c   D i g i t T i m e t t t t 
 
 V a r i a b l e   N u m e r i c   N u m T e s t 
 
 V a r i a b l e   N u m e r i c   N u m C y c l e s 
 
 
 
 V a r i a b l e   N u m e r i c   C o o r d _ Z 
 
 V a r i a b l e   N u m e r i c   C o o r d _ A 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X P 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X R 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d Z e r o 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 V a r i a b l e   S t r i n g   I n f o 
 
 V a r i a b l e   S t r i n g   R e s u l t 
 
 
 
 D i g i t T i m e   =   1 . 4 
 
 
 
 S a v e   S t r i n g T o F i l e   s 9   s 2 	 	 	 ' < < < < < < < < < < < < < < 
 
 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t M 0 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t M 0 
 
 K e y   U p   	 	 	 G o s u b   M o v e R i g h t M 1 
 
 K e y   D o w n   	 	 G o s u b   M o v e L e f t M 1 
 
 K e y   P a g e u p 	 	 G o s u b   M o v e U p M 2 
 
 K e y   P a g e d o w n 	 G o s u b   M o v e D o w n M 2 
 
 K e y   S 	 	 	 G o s u b   " S T A R T   T E S T " 
 
 
 
 G o s u b   R E D 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = =     P   I   N         T   E   S   T     = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " S T A R T   T E S T " 
 
 	 S a v e   S t r i n g T o F i l e   " - = - = - = - S T A R T - = - = - = - "   s 2 
 
 	 N u m T e s t   =   I n p u t   " T e l l   m e   h o w   m a n y   c y c l e : " 
 
 	 N u m C y c l e s   =   0 
 
 	 L a b e l   L o o p T e s t 
 
 	 	 N u m C y c l e s   =   N u m C y c l e s   +   1 
 
 	 	 I f   N u m C y c l e s   >   N u m T e s t 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 G o s u b   " H O M E   A l l " 
 
 	 	 G o s u b   " R a i s e   H a n d l e r " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   O N 
 
 	 	 C o o r d _ Z   =       1 8 
 
 	 	 C o o r d _ A   =     1 2 3 
 
 	 	 C o o r d _ X P   =   1 9 4 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   P A D L O C K " 
 
 	 	 C o o r d _ Z   =       3 8 
 
 	 	 C o o r d _ A   =       9 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   1 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =       9 3 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   2 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =     1 0 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   3 
 
 	 	 C o o r d _ Z   =       6 7 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   4 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =       9 3 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   5 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =     1 0 8 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   6 
 
 	 	 C o o r d _ Z   =       5 7 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 7 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   7 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =       9 3 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   8 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =     1 0 8 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   9 
 
 	 	 ' C o o r d _ Z   =       4 7 
 
 	 	 ' C o o r d _ A   =     1 2 2 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   0 
 
 	 	 ' C o o r d _ Z   =       3 7 
 
 	 	 ' C o o r d _ A   =     1 0 8 
 
 	 	 ' C o o r d _ X P   =   1 9 7 
 
 	 	 ' C o o r d _ X R   =   1 7 5 
 
 	 	 ' G o s u b   " E X E C " 
 
 	 	 ' '   - - - - - - - - - - - - - - - - - - - - -   B u t t o n   E N T E R 
 
 	 	 C o o r d _ Z   =       3 8 
 
 	 	 C o o r d _ A   =     1 2 2 
 
 	 	 C o o r d _ X P   =   1 9 6 
 
 	 	 C o o r d _ X R   =   1 7 5 
 
 	 	 G o s u b   " E X E C " 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 G o s u b   " L o w e r   H a n d l e r " 
 
 	 	 G o s u b   " C h e c k   L a t c h " 
 
 	 	 G o s u b   " H O U S E " 
 
 	 	 s 1   =   N o w 
 
 	 	 s 1   =   s 1   +   "   "   +   F o r m a t ( N u m C y c l e s ,   " 0 0 0 " )   +   "   "   +   R e s u l t 
 
 	 	 P r i n t   s 1 
 
 	 	 S a v e   S t r i n g T o F i l e   s 1   s 2 
 
 	 G o t o   L o o p T e s t 
 
 R e t u r n 
 
 
 
 L a b e l   " E X E C " 
 
 	 S l o t ( 5 )     =   C o o r d _ Z 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 2 5 )   =   C o o r d _ A 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 1 )     =   C o o r d _ X P 
 
 	 W a i t   S e c o n d s   D i g i t T i m e 
 
 	 G o s u b   P a u s e 
 
 	 S l o t ( 1 )     =   C o o r d _ X R 
 
 	 G o s u b   P a u s e 
 
 R e t u r n 
 
 
 
 L a b e l   " C h e c k   L a t c h " 
 
 	 S l o t ( 2 5 )   =     6 2           	 ' A   C h e c k   i f   l a t c h   i s   o u t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 I f   S l o t ( 3 2 )   >   5 0 0 
 
 	 	 R e s u l t   =   "   P A S S "   	 	 	 	 '   l a t c h   i n s i d e 
 
 	 E l s e 
 
 	 	 R e s u l t   =   "   < < <   F   A   I   L   > > > " 	 	 '   l a t c h   o u t s i d e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H A N D L E R   M A N A G E M E N T   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " R a i s e   H a n d l e r " 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     1 5 	   	 ' Z   p e p a r e   f o r   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   r a i S i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =   1 0 0 	       	 ' Z   r a i s e   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =     1 8 	       	 ' Z   L o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 7 5           	 ' X   g o t o   s a f e   a r e a 
 
 R e t u r n 
 
 
 
 L a b e l   " L o w e r   H a n d l e r " 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   p e p a r e   f o r   l o w e r   a r e a 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   l o w e r   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   h a n d l e   m a n a g e m e n t   a r e a 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =       5 	       	 ' Z   l o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   r e t u r n   h a n d l e r   t o   M i d d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - -   S   U   B   R   O   U   T   I   N   E       A   R   E   A     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   = = = = = = = = = = = = = = =   H O M E   A L L   M O T O R s   M 0 ,   M 1 ,   M 2   = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O M E   A l l " 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   5 
 
 	 G o s u b   " H o m e   M 3 ( A ) " 
 
 	 G o s u b   " H o m e   M 2 ( Z ) " 
 
 	 G o s u b   " H o m e   M 1 ( Y ) " 
 
 	 G o s u b   " H o m e   M 0 ( X ) " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 0 ( X ) " 
 
 	 S l o t M o t o r   =   1 
 
 	 S l o t S e n s o r   =   1 9 
 
 	 S p e e d S e a r c h   =   - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 1 ( Y ) " 
 
 	 S l o t M o t o r   =   3 
 
 	 S l o t S e n s o r   =   2 0 
 
 	 S p e e d S e a r c h   =   - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 2 ( Z ) " 
 
 	 S l o t M o t o r   =   5 
 
 	 S l o t S e n s o r   =   2 1 
 
 	 S p e e d S e a r c h   =   + 0 . 1 
 
 	 S p e e d R e t u r n   =   - 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   1 0 3 
 
 	 I n i t i a l P o s i t i o n   =   1 0 0 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 3 ( A ) " 
 
 	 S l o t M o t o r   =   2 5 
 
 	 S l o t S e n s o r   =   3 1 
 
 	 S p e e d S e a r c h   =   - 0 . 0 8 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   1 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O U S E   A L L   M O T O R S   M 0 ,   M 1 ,   M 3   = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O U S E " 
 
 	 S l o t ( 5 )     =     9 8 	   	 ' Z   R a i s e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =     2           	 ' X   g o   t o   H O U S E 
 
 	 S l o t ( 2 5 )   =     2           	 ' A   g o   t o   H O U S E 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   M O T O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H o m e " 
 
 	 G o s u b   R E D 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0             '   d e t a c h   I f   s e n s o r   a c t i v e 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
 	 L a b e l   S e a r c h H o m e 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   	 '   l i m i t   s w i t c h 
 
 	 	 	 G o s u b   W a i t M o t o r 	 	 	 '   W A I T   U N T I L   M O T O R   S T O P 
 
 	 	 	 G o t o   D e t a c h S e n s o r 
 
 	 	 E n d I f 
 
 	 	 G o t o   S e a r c h H o m e 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n   '   d i r e c t i o n / s p e e d   r e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   A s s i g n Z e r o 
 
 	 E n d I f 
 
 	 G o t o   D e t a c h S e n s o r 
 
 L a b e l   A s s i g n Z e r o 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 	 	 	 '   R e s e t   t h e   S l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 0 8 	 	     	 	 '   D O   N O T   T O U C H ,   n e e d e d   t o   t h e   M a s t e r ! ! ! ! 
 
 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d Z e r o 
 
 	 G o s u b   W a i t M o t o r 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   Y E L 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d   = = = = = = = = 
 
 L a b e l   W a i t M o t o r 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   i a   r u n n i n g 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t 1 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 	 	 	 '   n o w   t h e   m o t o r   i s   n o t   r u n n i n g 
 
 	 	 E n d I f 
 
 	 	 ' W a i t   S e c o n d s   0 . 0 0 5 
 
 	 G o t o   W a i t 1 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t M o t o r 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T     a l l   M O T O R S   a r e   S T O P P E D   = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t A l l M o t o r s 2 
 
 	 	 ' I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 )   )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1 
 
 	 	 I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 2 6 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 G o t o   W a i t A l l M o t o r s 2 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t A l l M o t o r s 
 
 
 
 '   = = = = = = = = = = = = = = =   E N A B L E   /   D I S A B L E   M O T O R S   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' L a b e l   E n a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 ' 
 
 ' L a b e l   D i s a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   1 0 0 0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   P A U S E   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P a u s e 
 
 	 L a b e l   P a u s e L o o p 
 
 	 	 I f   S l o t ( 1 2 )   >   5 0 0 
 
 	 	 	 W a i t   S e c o n d s   0 . 2 
 
 	 	 	 G o s u b   Y E L 
 
 	 	 E l s e 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 G o s u b   R E D 
 
 	 G o t o   P a u s e L o o p 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 F o r   v 1   =   0   T o   3 
 
 	 v 1   =   4 
 
 N e x t 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   1 0 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =   1 0 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =         0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =   1 0 0 0 	 	 ' G R E 
 
 R e t u r n 
 
 
 
 
 
 ' W A T C H   S l o t M o t o r 
 
 ' W A T C H   A b s ( S l o t ( S l o t M o t o r ) ) 
 
 ' W A T C H   n 1 2 3 4 5 
 
 ' W A T C H   s 1 2 3 4 5 
 
 ' W A T C H   v 1 
 
 ' W A T C H   3 2 3 
 
 ' W A T C H   v 1 
 
 ' W A T C H   s 1 
 
 ' W A T C H   s t r 
 
 ' W A T C H   S i n 2 
 
 ' E X E C   S i n 2   =   S i n ( 3 3 ) 
 
 